<template>
  <el-card class="box-card">
    <div class="text item">
      <el-table :data="apiData" style="width: 100%" :row-class-name="tableRowClassName">
        <template  v-for= "(item,index) in tableData" :key= "index"  >
          <el-table-column prop="apiData.prop" :label="item.label" width="180">

          </el-table-column>
        </template>
      </el-table>
    </div>
  </el-card>
</template>

<script>
  export default {
    methods: {
      tableRowClassName({ row, rowIndex }) {
        if (rowIndex === 1) {
          return 'warning-row';
        } else if (rowIndex === 3) {
          return 'success-row';
        }
        return '';
      }
    },
    data() {
      return {
        apiData: [],
        tableData: [
          {label:'Name_with_namespace', JobId:'Jobs ID',Name:"Name",prop:"Coverage",},
          {label:'Projects ID', JobId:'Jobs ID',Name:"Name",prop:"Coverage",},
          {label:'Owner', JobId:'Jobs ID',Name:"Name",prop:"Coverage",},
          {label:'created_at', JobId:'Jobs ID',Name:"Name",prop:"Coverage",},

        ]
      }
    }
  }
</script>
<style scoped>
  .el-table .warning-row {
    background: oldlace;
  }

  .el-table .success-row {
    background: #f0f9eb;
  }

  .text {
    font-size: 14px;
  }

  .item {
    padding: 18px 0;
  }

  .box-card {
    width: 800px;
  }
</style>
